/****************************************************************************************************************************************************************
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *                      _____  ___________                   ___    ______      ______           _____     _______________________                              *
 *                      __  / / /__  /_  /_____________ _    __ |  / /__(_)________  /_____________  /_    ___    |_____/_/__  __ \                             *
 *                      _  / / /__  /_  __/_  ___/  __ `/    __ | / /__  /_  __ \_  /_  _ \_  __ \  __/    __  /| |___/_/ __  / / /                             *
 *                      / /_/ / _  / / /_ _  /   / /_/ /     __ |/ / _  / / /_/ /  / /  __/  / / / /_      _  ___ |_/_/   _  /_/ /                              *
 *                      \____/  /_/  \__/ /_/    \__,_/      _____/  /_/  \____//_/  \___//_/ /_/\__/      /_/  |_/_/     /_____/                               *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *      @Project: Ultra Violent Attack and Defend                                                                                                               *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *      @Author: Daniel "thiaZ" Koenen                                                                                                                          *
 *          @Used content                                                                                                                                       *
 *              @sscanf, foreach, Whirlpool - Y_Less                                                                                                            *
 *              @zcmd - Zeex                                                                                                                                    *
 *              @streamer, irc - Incognito                                                                                                                      *
 *              @dini - Dracoblue                                                                                                                               *
 *              @MySQL - G-sTyLeZzZ                                                                                                                             *
 *          @Special thanks to                                                                                                                                  *
 *              @Slice                                                                                                                                          *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *      @File: uvaad.pwn - Main File                                                                                                                            *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *      @This file is not released under any open source licence, you are not allowed to own this file except you have the author's permission.                 *
 *                                                                                                                                                              *
 *                                                                                                                                                              *
 *      @copyright (c) Daniel "thiaZ" Koenen 2010 - 2011 - danielkoenen@t-online.de                                                                             *
 *                                                                                                                                                              *
 ****************************************************************************************************************************************************************/      

#include <a_samp>

#include "Compile_h.pwn"

#pragma dynamic 7000

// Local includes
#include "Resources\Libraries\sscanf.pwn"
#include "Resources\Libraries\zcmd.pwn"
#include "Resources\Libraries\streamer.pwn"
#include "Resources\Libraries\mysql.pwn"
#include "Resources\Libraries\progressbar.pwn"
#include "Resources\Libraries\geoip.pwn"
#include "Resources\Libraries\whirlpool.pwn"

// YSI includes
#include <YSI\y_hooks>
#include <YSI\y_hooks>
#include <YSI\y_timers>
#include <YSI\y_iterate>
#include <YSI\y_ini>

// MAX values
#define MAX_BASES               100
#define MAX_DMS                 20
#define MAX_ARENAS              20
#define MAX_WEAPONSETS          12

#undef MAX_PLAYERS
#define MAX_PLAYERS 25

#undef MAX_VEHICLES
#define MAX_VEHICLES 100

// World defines
#define LOBBY_WORLD             1
#define BASE_WORLD              2
#define ARENA_WORLD             3
#define DUEL_WORLD              4
#define DM_WORLD(%0)            1000 + %0

// Level defines
#define LEVEL_VIP               1
#define LEVEL_MOD               2
#define LEVEL_ADMIN             3
#define LEVEL_MANAGEMENT        4

// Team defines
#define TEAM_HOME               0
#define TEAM_AWAY               1
#define TEAM_REF                2
#define TEAM_HOME_SUB           3
#define TEAM_AWAY_SUB           4

// Dialog defines
#define DIALOG_LOGIN            1337
#define DIALOG_REGISTER         1337+1
#define DIALOG_WEAPONS          1337+2
#define DIALOG_SWITCH           1337+3
#define DIALOG_MYSTATS          1337+4
#define DIALOG_GETSTATS         1337+5
#define DIALOG_ADMIN            1337+6

#define DIALOG_CHOOSE           1337+7
#define DIALOG_MAIN             1337+8
#define DIALOG_DESCR            1337+9
#define DIALOG_CREATE           1337+10

#define DIALOG_CONFIG_MAIN      1337+100
#define DIALOG_CONFIG_TEAMS     1337+101
#define DIALOG_CONFIG_SKINS     1337+102
#define DIALOG_CONFIG_BASE      1337+103
#define DIALOG_CONFIG_HOMENAME  1337+104
#define DIALOG_CONFIG_AWAYNAME  1337+105
#define DIALOG_CONFIG_HOMESKIN  1337+106
#define DIALOG_CONFIG_AWAYSKIN  1337+107
#define DIALOG_CONFIG_REFSKIN   1337+108
#define DIALOG_CONFIG_MAXSCORE  1337+109
#define DIALOG_CONFIG_PREPTIME  1337+110
#define DIALOG_CONFIG_CPSIZE    1337+111
#define DIALOG_CONFIG_CPTIME    1337+112
#define DIALOG_CONFIG_ROUNDTME  1337+113
#define DIALOG_CONFIG_CARSPWN   1337+114
#define DIALOG_CONFIG_CARSPWND  1337+115
#define DIALOG_CONFIG_TAGDRAW   1337+116
#define DIALOG_CONFIG_REST      1337+117
#define DIALOG_CONFIG_WEAPON    1337+118
#define DIALOG_CONFIG_WSETS     1337+119
#define DIALOG_CONFIG_WSETS2    1337+120
#define DIALOG_CONFIG_WRES      1337+121
#define DIALOG_CONFIG_WRES2     1337+122

// Base end defines
#define CASE_ADMINEND   0
#define CASE_DEFWIN     1
#define CASE_ATTWIN     2
#define CASE_HOMEWIN    3
#define CASE_AWAYWIN    4

// Color defines
#define C_WHITE         0xFFFFFFFF
#define C_BLACK         0x000000FF
#define C_GREY          0x777777FF
#define C_YELLOW        0xFFFF00FF
#define C_GREEN         0x8CED15FF
#define C_PURPLE        0x662299FF
#define C_CYAN          0x33FF99FF
#define C_PINK          0xE81CC9FF
#define C_ORANGE        0xFFAA00FF
#define C_RED           0xFF0000FF
#define C_BLUE          0x337788FF
#define C_GOLD          0xDAA520FF
#define C_LIGHTBLUE     0x0AE2FAFF

#define C_INACTIVE_ATT  0xF23A3AFF
#define C_ATT           0xDE0000FF
#define C_ATT_SUB       0xFF8080FF

#define C_INACTIVE_DEF  0x4086F7FF
#define C_DEF           0x0054DBFF
#define C_DEF_SUB       0x6EA5FFFF

#define C_DEAD          0x777777FF

#define ATT_TAG         "~r~"
#define DEF_TAG         "~b~"

// Icon defines
#define BASE_ICON_ID    50
#define ARENA_ICON_H_ID 51
#define ARENA_ICON_A_ID 52

// Macro defines
#define SendFormattedMessage(%0,%1,%2,%3)   do{new _string[128]; format(_string,sizeof(_string),%2,%3); SendClientMessage(%0,%1,_string);} while(FALSE)
#define SendFormattedMessageToAll(%0,%1,%2) do{new _string[128]; format(_string,sizeof(_string),%1,%2); SendClientMessageToAll(%0,_string);} while(FALSE)
#define Admin(%0,%1)                        do{new _string[128]; format(_string,sizeof(_string),%0,%1); AdminMessage(_string);} while(FALSE)
#define Team(%0,%1,%2)                      do{new _string[128]; format(_string,sizeof(_string),%1,%2); TeamMessage(%0, _string);} while(FALSE)
#define loop_players(%0)                    foreach(Player, %0)
#define loop_vehicles(%0)                   foreach(Vehicle, %0)    
#define loop_bases(%0)                      foreach(Bases, %0)  

#if FEATURE_IRC
    #define hookIRC(%0,%1,%2)             CallRemoteFunction(%0, %1, %2)
#else
    #define hookIRC(%0,%1,%2)             doNothing(%0, %1, %2)
#endif

// C-like class defines
#define CBase::%0(      CBase_%0(
#define CArena::%0(     CArena_%0(
#define CPlayer::%0(    CPlayer_%0(
#define CAccount::%0(   CAccount_%0(
#define CDM::%0(        CDM_%0(
#define CDuel::%0(      CDuel_%0(
#define CIRC::%0(       CIRC_%0(
#define CTeleport::%0(  CTeleport_%0(
#define CConfig::%0(    CConfig_%0(
#define CCreation::%0(  CCreation_%0(

// y_iterator iterations
new Iterator:Vehicle<MAX_VEHICLES>,
    Iterator:Bases<MAX_BASES>,
    Iterator:IntBases<MAX_BASES>,
    Iterator:Arenas<MAX_ARENAS>,
    Iterator:IntArenas<MAX_ARENAS>;

main() { 
    printf("=====================================");
    printf("Loading UvA/D v%s.%s.%s", MAJOR, MINOR, BUILD);
    printf("Loading handlers...");
}

#include "Core\Enums.pwn"
#include "Core\Arrays.pwn"

#include "Core\Util.pwn"

#include "Entities\Player\Account.pwn"
#include "Entities\Player\Core.pwn"

#include "Core\GameConfig.pwn"

#include "Resources\BaseCreation.pwn"

#include "Games\Base.pwn"
#include "Games\Arena.pwn"
#include "Games\Deathmatch.pwn"
#include "Games\Duel.pwn"

#include "Entities\Player\Commands.pwn"
